﻿using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;



/*
 IAuthorizationRequirement 是一个空接口，具体对于授权的需求，其属性等信息是自定义的
 这里的继承关系也没有任何意义
 */
namespace ManageSystem.AuthorizationRequirement
{
    // 可访问project system的权限
    public class PermissionRequirement: IAuthorizationRequirement
    {
        public List<PermissionData> Permissions { get; set; }
        
        public PermissionRequirement(List<PermissionData> permissions)
        {
            Permissions = permissions;
        }
    }

    public class PermissionData
    {
        /// <summary>
        /// userName
        /// </summary>
        public string username { get; set; }
        /// <summary>
        /// 用户请求url
        /// </summary>
        public string url { get; set; }

        public PermissionData(string username, string url)
        {
            this.username = username;
            this.url = url;
        }
    }
}
